//
// Created by leon on 8/18/2024.
//

#include "thread.h"

#define PG_SIZE 4096

static void kernel_thread(thread_func* function, void* func_arg) {
    function(func_arg);
}

void thread_create(struct task_struct* pthread, thread_func function, void* func_arg) {

}

/*
 * 初始化线程基本信息
 */
void init_thread() {

}

struct task_struct* thread_start(char* name, int prio, thread_func function, void* func_arg) {
    //内核中申请一页内存，4096个字节，将其赋值给新创建的PCB指针，即struct task_struct* thread
    struct task_struct* thread = get_kernel_pages(1);
    init_thread(thread, name, prio);
    thread_create(thread, function, func_arg);


}